package tw.miku.protocol.codec.login;

import org.apache.mina.core.buffer.IoBuffer;

import tw.miku.constants.ProtocalConstants;
import tw.miku.protocol.codec.AbstractRequestMessagePack;
import tw.miku.util.BufferUtility;

public class LoginRequestPack extends AbstractRequestMessagePack
{

	public String username;
	public String password;

	public LoginRequestPack(IoBuffer buffer)
	{
		super(buffer);
	}

	@Override
	public void decode()
	{ 
		super.decode();
		buffer.position(4);
		username =  BufferUtility.readString(buffer);
		password = BufferUtility.readString(buffer);
	}
	
	@Override
	public short getTag()
	{
		return ProtocalConstants.LOGIN;
	}

}
